﻿CREATE PROCEDURE dbo.sp_Insert_Lead
	(
	@KeyNumber		VARCHAR(9),
	@PersonID		VARCHAR(9),
	@FirstName		VARCHAR(15),
	@MiddleName		VARCHAR(15),
	@LastName		VARCHAR(15),
	@Address1		VARCHAR(30),
	@Address2		VARCHAR(30),
	@City			VARCHAR(20),
	@State			VARCHAR(2),
	@Zip			VARCHAR(5),
	@Zip4			VARCHAR(4),
	@Gender			VARCHAR(1),
	@TelNumber		VARCHAR(10),
	@BirthYear		VARCHAR(4),
	@BirthMonth		VARCHAR(2),
	@BirthDay		VARCHAR(2),
	@Age			VARCHAR(2),
	@DecileScore	VARCHAR(2),
	@ModelType		VARCHAR(1),
	@FEDDNClnd		VARCHAR(1),
	@ExpireYear		VARCHAR(4),
	@ExpireMonth	VARCHAR(2),
	@ExpireDay		VARCHAR(2),
	@MaritalStatus	VARCHAR(1),
	@Open1			VARCHAR(5),
	@SequenceNumber	VARCHAR(7),
	@Open2			VARCHAR(2),
	@Open3			VARCHAR(2),
	@RequesterZip	VARCHAR(8),
	@Division		VARCHAR(2),
	@Region			VARCHAR(2),
	@Market			VARCHAR(2),
	@Territory		VARCHAR(2)
	)
AS
	--SET NOCOUNT ON
	--INSERT INTO Leads 
	--(
	--KeyNumber, PersonID, FirstName, MiddleName, LastName, Address1, Address2, City, State, Zip, Zip4, Gender, TelNumber,		
	--BirthYear, BirthMonth, BirthDay, Age, DecileScore, ModelType, FEDDNClnd, ExpireYear, ExpireMonth, ExpireDay, MaritalStatus,	
	--Open1, SequenceNumber, Open2, Open3, RequesterZip, Division, Region, Market, Territory
	--)
	--VALUES 
	--(
		--@KeyNumber, @PersonID, @FirstName, @MiddleName, @LastName, @Address1, @Address2, @City, @State, @Zip, @Zip4, @Gender, @TelNumber,
		--@BirthYear, @BirthMonth, @BirthDay, @Age, @DecileScore, @ModelType, @FEDDNClnd, @ExpireYear, @ExpireMonth, @ExpireDay, @MaritalStatus,
		--@Open1, @SequenceNumber, @Open2, @Open3, @RequesterZip, @Division, @Region, @Market, @Territory
	--)
	
	--IF NOT EXISTS (SELECT * FROM dbo.Zips WHERE Zip = @Zip)
	--BEGIN
		--INSERT INTO [dbo].[Zips]
           --([Zip])
     --VALUES
           --(@Zip)
	--END
	

